package com.wzy.netty.core.inboundhandlerandoutboundhandler;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ReplayingDecoder;

import java.util.List;

/**
 * 描述  : ReplayingDecoder  比 ByteToMessageDecoder 更智能,可以自己判断内容长度是否符合要求
 * 创建人:    Wzy
 * 创建时间: 2020-06-12  0:07
 */
public class MyByteToLongDecoder2 extends ReplayingDecoder<Long> {
    @Override
    protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception {
        list.add(byteBuf.readLong());
    }
}
